home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / 3FootNinja.swf / scripts / frame_232 / PlaceObject2_471_39 / CLIPACTIONRECORD onClipEvent(enterFrame).as
Encoding:
Text File  |  2007-05-31  |  1.1 KB  |  38 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.ninja._x > this._x && this._name != "dead" && this._name != "enemyRoll")
  3.    {
  4.       this._xscale = - Math.abs(this._xscale);
  5.       _root.enemyLeft = true;
  6.    }
  7.    else if(_root.ninja._x <= this._x && this._name != "dead" && this._name != "enemyRoll")
  8.    {
  9.       this._xscale = Math.abs(this._xscale);
  10.       _root.enemyLeft = false;
  11.    }
  12.    if(_X > _root.ninja._x + 140 && this._name != "dead" && _root.enemyHit != true && this._name != "enemyRoll")
  13.    {
  14.       this.gotoAndStop(1);
  15.       _X = _X - (Math.random() * 5 + 3);
  16.    }
  17.    else if(_X < _root.ninja._x - 140 && this._name != "dead" && _root.enemyHit != true && this._name != "enemyRoll")
  18.    {
  19.       this.gotoAndStop(1);
  20.       _X = _X + (Math.random() * 5 + 3);
  21.    }
  22.    else if(_X <= _root.ninja._x + 45 || _X >= _root.ninja._x - 45)
  23.    {
  24.       if(_root.enemyHit != true && this._currentframe != 3 && this._name != "dead" && this._name != "enemyRoll")
  25.       {
  26.          this.gotoAndStop(2);
  27.       }
  28.    }
  29.    if(this._x < 10)
  30.    {
  31.       this.gotoAndPlay(50);
  32.    }
  33.    else if(this._x > 535)
  34.    {
  35.       this.gotoAndPlay(50);
  36.    }
  37. }
  38.